﻿using System;
using SharpSqlAnalyzer.nodes;

namespace SharpSqlAnalyzer.stmt.mysql
{
	// Token: 0x02000154 RID: 340
	public class TMySQLDeclare : TCustomMySQLStmt
	{
		// Token: 0x06000B73 RID: 2931 RVA: 0x00306245 File Offset: 0x00304445
		public TMySQLDeclare(EDbVendor dbvendor) : base(dbvendor)
		{
			this.sqlstatementtype = ESqlStatementType.sstmysqldeclare;
		}

		// Token: 0x06000B74 RID: 2932 RVA: 0x00306260 File Offset: 0x00304460
		internal override void buildsql()
		{
		}

		// Token: 0x06000B75 RID: 2933 RVA: 0x00306262 File Offset: 0x00304462
		internal override void clear()
		{
		}

		// Token: 0x06000B76 RID: 2934 RVA: 0x00306264 File Offset: 0x00304464
		internal override string getasprettytext()
		{
			return "";
		}

		// Token: 0x17000219 RID: 537
		// (get) Token: 0x06000B77 RID: 2935 RVA: 0x0030626B File Offset: 0x0030446B
		// (set) Token: 0x06000B78 RID: 2936 RVA: 0x00306273 File Offset: 0x00304473
		public virtual TObjectName CursorName
		{
			get
			{
				return this.cursorName;
			}
			set
			{
				this.cursorName = value;
			}
		}

		// Token: 0x1700021A RID: 538
		// (get) Token: 0x06000B79 RID: 2937 RVA: 0x0030627C File Offset: 0x0030447C
		// (set) Token: 0x06000B7A RID: 2938 RVA: 0x00306284 File Offset: 0x00304484
		public virtual EDeclareType DeclareType
		{
			get
			{
				return this.declareType;
			}
			set
			{
				this.declareType = value;
			}
		}

		// Token: 0x1700021B RID: 539
		// (get) Token: 0x06000B7B RID: 2939 RVA: 0x0030628D File Offset: 0x0030448D
		// (set) Token: 0x06000B7C RID: 2940 RVA: 0x00306295 File Offset: 0x00304495
		public virtual TDeclareVariableList Variables
		{
			get
			{
				return this.variables;
			}
			set
			{
				this.variables = value;
			}
		}

		// Token: 0x06000B7D RID: 2941 RVA: 0x003062A0 File Offset: 0x003044A0
		public override int doParseStatement(TCustomSqlStatement psql)
		{
			if (this.rootNode == null)
			{
				return -1;
			}
			TDeclareSqlNode tdeclareSqlNode = (TDeclareSqlNode)this.rootNode;
			base.doParseStatement(psql);
			this.declareType = tdeclareSqlNode.DeclareType;
			if (this.declareType == EDeclareType.variable)
			{
				this.variables = tdeclareSqlNode.Variables;
			}
			return 0;
		}

		// Token: 0x06000B7E RID: 2942 RVA: 0x003062ED File Offset: 0x003044ED
		public override void accept(TParseTreeVisitor v)
		{
			v.preVisit(this);
			v.postVisit(this);
		}

		// Token: 0x06000B7F RID: 2943 RVA: 0x003062FD File Offset: 0x003044FD
		public override void acceptChildren(TParseTreeVisitor v)
		{
			v.preVisit(this);
			if (this.variables != null)
			{
				this.variables.acceptChildren(v);
			}
			v.postVisit(this);
		}

		// Token: 0x040012B3 RID: 4787
		private TObjectName cursorName;

		// Token: 0x040012B4 RID: 4788
		private EDeclareType declareType = EDeclareType.variable;

		// Token: 0x040012B5 RID: 4789
		private TDeclareVariableList variables;
	}
}
